package com.timesheet.server.dao;

import java.util.ArrayList;
import java.util.List;

import com.timesheet.server.common.models.TaskTypeDTO;
import com.timesheet.server.core.dao.BaseDao;
import com.timesheet.server.core.mapper.Mapper;
import com.timesheet.server.core.models.TaskType;

public class TaskTypeDao extends BaseDao {

	public boolean createTaskType(TaskTypeDTO taskTypeDto) {
		TaskType taskType = new Mapper<TaskType>().map(new TaskType(), taskTypeDto);
		return persist(taskType);
	}

	public List<TaskTypeDTO> getAllTaskTypes() {
		List<TaskTypeDTO> taskTypeDtoList = new ArrayList<TaskTypeDTO>();

		/*List all = getAll("select t from TaskType t");
		for (Object object : all) {
			
			TaskType taskType = (TaskType)object ;
			TaskTypeDTO taskTypeDTO = new TaskTypeDTO();
			taskTypeDTO.setTaskId(taskType.getTaskTypeId());
			taskTypeDTO.setTaskName(taskType.getTaskTypeName());
			taskTypeDtoList.add(taskTypeDTO);
		}
		*/
		return taskTypeDtoList;
	}

}
